package com.js.foodordersystem.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 存储订单的具体菜品详情(OrderItem)实体类
 *
 * @author makejava
 * @since 2025-01-09 10:52:50
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderItem implements Serializable {
    private static final long serialVersionUID = -64329696265393043L;
    /**
     * 订单详情ID，主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long orderItemId;
    /**
     * 订单ID，关联订单表
     */
    private Long orderId;
    /**
     * 菜品ID，关联菜品表
     */
    private Long dishId;
    /**
     * 购买数量
     */
    private Integer quantity;
    /**
     * 菜品单价
     */
    private BigDecimal price;
    /**
     * 菜品总价，单价乘以数量
     */
    private BigDecimal totalPrice;
    /**
     * 记录创建时间
     */
    private Date createdAt;
    /**
     * 记录更新时间
     */
    private Date updatedAt;


}

